<?php
class SearchSelectItem extends DomArObject {
	
	/**
	 * @orm text
	 */
	public $name;
	
	/**
	 * @orm int(11)
	 */
	public $age;
	
	

	public static function populateDatabase() {
		
		SearchSelectItem::getTable()->update();
		
		if( SearchSelectItem::query()->limit(1)->commit() )
			return;
		
			
		$names = array('Mari','Peeter','Kalle','Oliver','Getter','Maarika','Meelis','Anne','Janika','Veronika','Allan','Tõnis','Oskar');
		
		foreach( $names as $name ) {
			$i = new  SearchSelectItem();
			$i->name = $name;
			$i->age = mt_rand(20,60);
			$i->save();
		}
		
		
	}
	
}
?>